<template>
	<view class="newsDetail">
		<text class="tit">{{item.title}}</text>
		<view class="info">
			<u-icon name="calendar"></u-icon><text>{{item.times}}</text>
			<u-icon name="eye"></u-icon> <text>{{item.hit}}</text>
		</view>
		<view class="content" v-html="item.content">
		</view>
	</view>
</template>

<script>
	import { getDetail } from "@/api/api.js"
	export default {
		data() {
			return {
				id:0,
				item:[]
			}
		},
		methods: {
			async getNewsDetail(){
				
				var data = {
					id:this.id,
				}
				await getDetail(data).then((res) => {
					console.log('data')
					console.log(res)
					this.item = res
				}).catch(() => {
				
				})
				console.log(this.id)
				// const res = await this.$myRequest({
				// 	url: '/index.php/api/index/newsdetail/?id='+this.id
				// })
				// this.item = res.data.data
			}
		},
		onLoad(options){
			this.id = options.id
			this.getNewsDetail()
		}
	}
</script>

<style lang="scss">
.newsDetail{
	padding:20rpx;
	.tit{
		font-size: 50rpx;
	}
	.info{
		font-size: 30rpx;
		color:#999;
		display: flex;
		align-items: center;
		gap: 10rpx;
		font-size: 24rpx;
	}
	.content{
		
	}
}
</style>
